package com.js.rtu.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.js.rtu.R;
import com.js.rtu.greendao.db.HistoryBean;
import com.js.rtu.greendao.db.HistoryInfoBean;
import com.js.rtu.util.DateFormatUtils;

import java.util.List;

/**
 * 历史
 * Created by wz on 2021/6/28.
 */
public class HistoryListAdapter extends BaseQuickAdapter<HistoryInfoBean, BaseViewHolder> {





    public HistoryListAdapter(List<HistoryInfoBean> data) {
        super(R.layout.item_history_list, data);
    }




    @Override
    protected void convert(BaseViewHolder helper, HistoryInfoBean historyBean) {
        String time = DateFormatUtils.long2Str(historyBean.getOperaTime(), "yyyy-MM-dd HH:mm:ss");//班巡开始时间
        helper.setText(R.id.tv_time,time );
        helper.setText(R.id.tv_start_end,historyBean.getStartTime()+"-"+historyBean.getEndTime() );
        helper.setText(R.id.tv_interval,historyBean.getInterval()+"" );
        helper.setText(R.id.tv_device,historyBean.getDeviceId());
        helper.setText(R.id.tv_total,historyBean.getTotal());



    }


}
